import time
from selenium.webdriver.support.ui import WebDriverWait
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC


#//*[@id="fromStationText"] 出发地
#//*[@id="toolbar_Div"]/div[3]/div[2]/div/div[1]/div/div[2]/div[1]/div[1]/div[1]/div[2]/label
browser = webdriver.Chrome()
browser.get('https://www.12306.cn/index/')

id_from_word = 'fromStationText'


locator = (By.ID, id_from_word)

wait = WebDriverWait(browser, 10).until(EC.presence_of_element_located(locator))


input  = browser.find_element(By.ID, id_from_word)


input.clear()
input.send_keys("厦门北")

id_to_word = 'toStationText'

locator = (By.ID, id_to_word)

input  = browser.find_element(By.ID, id_to_word)

input.clear()
input.send_keys("乌鲁木齐")
time.sleep(5)

browser.quit()